package com.simplefaith.delisty.model;

import android.content.Context;
import android.os.Handler;

import com.simplefaith.delisty.util.ActivitySwitcher;

public class SwitchActivityHandler extends Handler {

	private Runnable run;

	public SwitchActivityHandler(final Context context,
			final Class<?> switchedClass,final boolean finishActivity) {

		this.run = new Runnable() {
			@Override
			public void run() {

				/* Create an Intent that will start the Menu-Activity. */

				ActivitySwitcher.switchActivity(context, switchedClass,finishActivity);

				removeCallbacks(run);
			}
		};
	}

	public void startHandler(long delayMills) {
		this.postDelayed(run, delayMills);
	}

}
